//
//  ILGMemoryModule.m
//  ILGDemo
//
//  Created by happy on 2020/3/11.
//  Copyright © 2020 Happy. All rights reserved.
//

#import "ILGMemoryModule.h"

//void(^block)(void);

@interface ILGMemoryModule ()
@end

@implementation ILGMemoryModule

- (void)performTestMethod
{
    
}

- (void)testForBridge
{
    void *p = 0;
    {
        id obj = [[NSObject alloc] init];
        p = (__bridge_retained void *)obj;
        //        p = (__bridge void *)obj; // 报错，obj出了作用域就会销毁，__bridge不改变持有情况，所以p成为悬垂指针
    }
    
    NSLog(@"class===%@",[(__bridge id)p class]);
}

- (void)testForAutoreleasePool
{
    int lagerNum = 8000000;
    for(int i = 0; i <lagerNum; i++) {
        @autoreleasepool {
            UIImage *image = [UIImage imageNamed:@"girl"];

        }
    }
}

@end
